package com.sgb.trip.view.adapter;

import android.annotation.SuppressLint;
import android.content.Context;

import androidx.databinding.DataBindingUtil;

import com.sgb.trip.R;
import com.sgb.trip.databinding.TripItemPassengerFromDetailBinding;
import com.sgb.trip.entity.FlightOrderDetailEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

/**
 * Time:2021/6/18
 * Author:黄淋
 * Description:订单页已选择的乘客的adapter
 */
public class PassengerFromDetailAdapter extends BaseRecycleAdapter<FlightOrderDetailEntity.PassengersBean> {

    public PassengerFromDetailAdapter(Context context, List<FlightOrderDetailEntity.PassengersBean> datas) {
        super(context, R.layout.trip_item_passenger_from_detail, datas);
    }

    @SuppressLint("UseCompatLoadingForDrawables")
    @Override
    public void convert(ItemViewHolder holder, FlightOrderDetailEntity.PassengersBean entity) {

        TripItemPassengerFromDetailBinding binding = DataBindingUtil.bind(holder.itemView);
        binding.tvPassengerNameValue.setText(entity.getPassengerName());
        binding.tvPassengerCardValue.setText(entity.getCardNo());
    }
}
